<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>EasyIO-GPRS-Framework: rtdef.h源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- 制作者 Doxygen 1.6.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
--></script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="modules.html"><span>模块</span></a></li>
      <li><a href="annotated.html"><span>类</span></a></li>
      <li class="current"><a href="files.html"><span>文件</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <img id="MSearchSelect" src="search/search.png"
             onmouseover="return searchBox.OnSearchSelectShow()"
             onmouseout="return searchBox.OnSearchSelectHide()"
             alt=""/>
        <input type="text" id="MSearchField" value="搜索" accesskey="S"
             onfocus="searchBox.OnSearchFieldFocus(true)" 
             onblur="searchBox.OnSearchFieldFocus(false)" 
             onkeyup="searchBox.OnSearchFieldChange(event)"/>
        <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
        </div>
      </li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>文件列表</span></a></li>
      <li><a href="globals.html"><span>文件成员</span></a></li>
    </ul>
  </div>
<h1>rtdef.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * File      : rtdef.h</span>
<a name="l00003"></a>00003 <span class="comment"> * This file is part of RT-Thread RTOS</span>
<a name="l00004"></a>00004 <span class="comment"> * COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team</span>
<a name="l00005"></a>00005 <span class="comment"> *</span>
<a name="l00006"></a>00006 <span class="comment"> * The license and distribution terms for this file may be</span>
<a name="l00007"></a>00007 <span class="comment"> * found in the file LICENSE in this distribution or at</span>
<a name="l00008"></a>00008 <span class="comment"> * http://www.rt-thread.org/license/LICENSE</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * Change Logs:</span>
<a name="l00011"></a>00011 <span class="comment"> * Date           Author       Notes</span>
<a name="l00012"></a>00012 <span class="comment"> * 2007-01-10     Bernard      the first version</span>
<a name="l00013"></a>00013 <span class="comment"> * 2008-07-12     Bernard      remove all rt_int8, rt_uint32_t etc typedef</span>
<a name="l00014"></a>00014 <span class="comment"> * 2010-10-26     yi.qiu       add module support</span>
<a name="l00015"></a>00015 <span class="comment"> * 2010-11-10     Bernard      add cleanup callback function in thread exit.</span>
<a name="l00016"></a>00016 <span class="comment"> * 2011-05-09     Bernard      use builtin va_arg in GCC 4.x</span>
<a name="l00017"></a>00017 <span class="comment"> * 2012-11-16     Bernard      change RT_NULL from ((void*)0) to 0. </span>
<a name="l00018"></a>00018 <span class="comment"> * 2012-12-29     Bernard      change the RT_USING_MEMPOOL location and add</span>
<a name="l00019"></a>00019 <span class="comment"> *                             RT_USING_MEMHEAP condition.</span>
<a name="l00020"></a>00020 <span class="comment"> * 2012-12-30     Bernard      add more control command for graphic.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022  
<a name="l00023"></a>00023 <span class="preprocessor">#ifndef __RT_DEF_H__</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define __RT_DEF_H__</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;rtconfig.h&gt;</span>
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {
<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span>
<a name="l00037"></a>00037 
<a name="l00038"></a>00038 <span class="comment">/* RT-Thread version information */</span>
<a name="l00039"></a><a class="code" href="group__BasicDef.html#gad78104e02f13751dab9952ba4d9788f8">00039</a> <span class="preprocessor">#define RT_VERSION                      1L              </span>
<a name="l00040"></a><a class="code" href="group__BasicDef.html#gae2986d88dd8f5b076c9089931463c6d2">00040</a> <span class="preprocessor">#define RT_SUBVERSION                   1L              </span>
<a name="l00041"></a><a class="code" href="group__BasicDef.html#ga8ac050659ff67d9c8be5b59ddd1790cc">00041</a> <span class="preprocessor">#define RT_REVISION                     0L              </span>
<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="comment">/* RT-Thread version */</span>
<a name="l00044"></a>00044 <span class="preprocessor">#define RTTHREAD_VERSION                ((RT_VERSION * 10000) + \</span>
<a name="l00045"></a>00045 <span class="preprocessor">                                         (RT_SUBVERSION * 100) + RT_REVISION)</span>
<a name="l00046"></a>00046 <span class="preprocessor"></span>
<a name="l00047"></a>00047 <span class="comment">/* RT-Thread basic data type definitions */</span>
<a name="l00048"></a><a class="code" href="group__BasicDef.html#ga0718c1881c49fdb1cfd55946ddfe0f64">00048</a> <span class="keyword">typedef</span> <span class="keywordtype">signed</span>   <span class="keywordtype">char</span>                   <a class="code" href="group__BasicDef.html#ga0718c1881c49fdb1cfd55946ddfe0f64">rt_int8_t</a>;      
<a name="l00049"></a><a class="code" href="group__BasicDef.html#gad48863e8de10f558c764213f434d14cd">00049</a> <span class="keyword">typedef</span> <span class="keywordtype">signed</span>   <span class="keywordtype">short</span>                  <a class="code" href="group__BasicDef.html#gad48863e8de10f558c764213f434d14cd">rt_int16_t</a>;     
<a name="l00050"></a><a class="code" href="group__BasicDef.html#gae5c6ccee15f067714ca9c44e509c4047">00050</a> <span class="keyword">typedef</span> <span class="keywordtype">signed</span>   <span class="keywordtype">long</span>                   <a class="code" href="group__BasicDef.html#gae5c6ccee15f067714ca9c44e509c4047">rt_int32_t</a>;     
<a name="l00051"></a><a class="code" href="group__BasicDef.html#ga585e2ad0fbab0f83817cb61373465df6">00051</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>                   <a class="code" href="group__BasicDef.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a>;     
<a name="l00052"></a><a class="code" href="group__BasicDef.html#ga5acba55f46553417996ac70828b874da">00052</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span>                  <a class="code" href="group__BasicDef.html#ga5acba55f46553417996ac70828b874da">rt_uint16_t</a>;    
<a name="l00053"></a><a class="code" href="group__BasicDef.html#ga909edcac80e5e3f93f63fcebc95922c7">00053</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>                   <a class="code" href="group__BasicDef.html#ga909edcac80e5e3f93f63fcebc95922c7">rt_uint32_t</a>;    
<a name="l00054"></a><a class="code" href="group__BasicDef.html#ga3e03a3519ef7e33d13ebd34c482db49c">00054</a> <span class="keyword">typedef</span> <span class="keywordtype">int</span>                             <a class="code" href="group__BasicDef.html#ga3e03a3519ef7e33d13ebd34c482db49c">rt_bool_t</a>;      
<a name="l00056"></a>00056 <span class="comment">/* 32bit CPU */</span>
<a name="l00057"></a><a class="code" href="group__BasicDef.html#gab7ede51a23ea8b78381b5a59506edd7d">00057</a> <span class="keyword">typedef</span> <span class="keywordtype">long</span>                            <a class="code" href="group__BasicDef.html#gab7ede51a23ea8b78381b5a59506edd7d">rt_base_t</a>;      
<a name="l00058"></a><a class="code" href="group__BasicDef.html#ga958cc0f5d3f7bf59850cd8bd13a4aeb0">00058</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>                   <a class="code" href="group__BasicDef.html#ga958cc0f5d3f7bf59850cd8bd13a4aeb0">rt_ubase_t</a>;     
<a name="l00060"></a><a class="code" href="group__BasicDef.html#ga42df42aabf676f2a89f5af2208b79950">00060</a> <span class="keyword">typedef</span> rt_base_t                       <a class="code" href="group__BasicDef.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>;       
<a name="l00061"></a><a class="code" href="group__BasicDef.html#ga102dfa15727cd1166d97cf5392dfe3b9">00061</a> <span class="keyword">typedef</span> rt_uint32_t                     <a class="code" href="group__BasicDef.html#ga102dfa15727cd1166d97cf5392dfe3b9">rt_time_t</a>;      
<a name="l00062"></a><a class="code" href="group__BasicDef.html#ga66c400929925784dba020d671154978a">00062</a> <span class="keyword">typedef</span> rt_uint32_t                     <a class="code" href="group__BasicDef.html#ga66c400929925784dba020d671154978a">rt_tick_t</a>;      
<a name="l00063"></a><a class="code" href="group__BasicDef.html#gac0517c5e13c1374877d8462b84e72755">00063</a> <span class="keyword">typedef</span> rt_base_t                       <a class="code" href="group__BasicDef.html#gac0517c5e13c1374877d8462b84e72755">rt_flag_t</a>;      
<a name="l00064"></a><a class="code" href="group__BasicDef.html#ga8011d259fdfc54b8a9aa006b4d49ac14">00064</a> <span class="keyword">typedef</span> rt_ubase_t                      <a class="code" href="group__BasicDef.html#ga8011d259fdfc54b8a9aa006b4d49ac14">rt_size_t</a>;      
<a name="l00065"></a><a class="code" href="group__BasicDef.html#ga79ffea5dac0a5c145822b5b1c9b55a09">00065</a> <span class="keyword">typedef</span> rt_ubase_t                      <a class="code" href="group__BasicDef.html#ga79ffea5dac0a5c145822b5b1c9b55a09">rt_dev_t</a>;       
<a name="l00066"></a><a class="code" href="group__BasicDef.html#ga0fd4981851ce935649b6723a81f2f1bf">00066</a> <span class="keyword">typedef</span> rt_base_t                       <a class="code" href="group__BasicDef.html#ga0fd4981851ce935649b6723a81f2f1bf">rt_off_t</a>;       
<a name="l00068"></a>00068 <span class="comment">/* boolean type definitions */</span>
<a name="l00069"></a><a class="code" href="group__BasicDef.html#ga5e3d4a1b993df67473bc161096dba218">00069</a> <span class="preprocessor">#define RT_TRUE                         1               </span>
<a name="l00070"></a><a class="code" href="group__BasicDef.html#gaad465603954df66df7791befd55ff325">00070</a> <span class="preprocessor">#define RT_FALSE                        0               </span>
<a name="l00073"></a>00073 <span class="preprocessor"></span>
<a name="l00074"></a>00074 <span class="preprocessor"></span><span class="comment">/* maximum value of base type */</span>
<a name="l00075"></a>00075 <span class="preprocessor">#define RT_UINT8_MAX                    0xff            </span>
<a name="l00076"></a>00076 <span class="preprocessor">#define RT_UINT16_MAX                   0xffff          </span>
<a name="l00077"></a>00077 <span class="preprocessor">#define RT_UINT32_MAX                   0xffffffff      </span>
<a name="l00078"></a>00078 <span class="preprocessor">#define RT_TICK_MAX                     RT_UINT32_MAX   </span>
<a name="l00080"></a>00080 <span class="preprocessor"></span><span class="comment">/* Compiler Related Definitions */</span>
<a name="l00081"></a>00081 <span class="preprocessor">#ifdef __CC_ARM                         </span><span class="comment">/* ARM Compiler */</span>
<a name="l00082"></a>00082 <span class="preprocessor">    #include &lt;stdarg.h&gt;</span>
<a name="l00083"></a>00083 <span class="preprocessor">    #define SECTION(x)                  __attribute__((section(x)))</span>
<a name="l00084"></a>00084 <span class="preprocessor"></span><span class="preprocessor">    #define UNUSED                      __attribute__((unused))</span>
<a name="l00085"></a>00085 <span class="preprocessor"></span><span class="preprocessor">    #define ALIGN(n)                    __attribute__((aligned(n)))</span>
<a name="l00086"></a>00086 <span class="preprocessor"></span><span class="preprocessor">    #define rt_inline                   static __inline</span>
<a name="l00087"></a>00087 <span class="preprocessor"></span>    <span class="comment">/* module compiling */</span>
<a name="l00088"></a>00088 <span class="preprocessor">    #ifdef RT_USING_MODULE</span>
<a name="l00089"></a>00089 <span class="preprocessor"></span><span class="preprocessor">        #define RTT_API                 __declspec(dllimport)</span>
<a name="l00090"></a>00090 <span class="preprocessor"></span><span class="preprocessor">    #else</span>
<a name="l00091"></a>00091 <span class="preprocessor"></span><span class="preprocessor">        #define RTT_API                 __declspec(dllexport)</span>
<a name="l00092"></a>00092 <span class="preprocessor"></span><span class="preprocessor">    #endif</span>
<a name="l00093"></a>00093 <span class="preprocessor"></span>
<a name="l00094"></a>00094 <span class="preprocessor">#elif defined (__IAR_SYSTEMS_ICC__)     </span><span class="comment">/* for IAR Compiler */</span>
<a name="l00095"></a>00095 <span class="preprocessor">    #include &lt;stdarg.h&gt;</span>
<a name="l00096"></a>00096 <span class="preprocessor">    #define SECTION(x)                  @ x</span>
<a name="l00097"></a>00097 <span class="preprocessor"></span><span class="preprocessor">    #define UNUSED</span>
<a name="l00098"></a>00098 <span class="preprocessor"></span><span class="preprocessor">    #define PRAGMA(x)                   _Pragma(#x)</span>
<a name="l00099"></a>00099 <span class="preprocessor"></span><span class="preprocessor">    #define ALIGN(n)                    PRAGMA(data_alignment=n)</span>
<a name="l00100"></a>00100 <span class="preprocessor"></span><span class="preprocessor">    #define rt_inline                   static inline</span>
<a name="l00101"></a>00101 <span class="preprocessor"></span><span class="preprocessor">    #define RTT_API</span>
<a name="l00102"></a>00102 <span class="preprocessor"></span>
<a name="l00103"></a>00103 <span class="preprocessor">#elif defined (__GNUC__)                </span><span class="comment">/* GNU GCC Compiler */</span>
<a name="l00104"></a>00104 <span class="preprocessor">    #ifdef RT_USING_NEWLIB</span>
<a name="l00105"></a>00105 <span class="preprocessor"></span><span class="preprocessor">        #include &lt;stdarg.h&gt;</span>
<a name="l00106"></a>00106 <span class="preprocessor">    #else</span>
<a name="l00107"></a>00107 <span class="preprocessor"></span><span class="preprocessor">        #if __GNUC__ &lt; 4</span>
<a name="l00108"></a>00108 <span class="preprocessor"></span>            <span class="keyword">typedef</span> <span class="keywordtype">void</span> *__sys_va_list;
<a name="l00109"></a>00109             <span class="keyword">typedef</span> __sys_va_list       va_list;
<a name="l00110"></a>00110 <span class="preprocessor">            #define __va_rounded_size(type) \</span>
<a name="l00111"></a>00111 <span class="preprocessor">                (((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))</span>
<a name="l00112"></a>00112 <span class="preprocessor"></span><span class="preprocessor">            #define va_start(ap, lastarg)   \</span>
<a name="l00113"></a>00113 <span class="preprocessor">                (ap = ((char *) &amp;(lastarg) + __va_rounded_size(lastarg)))</span>
<a name="l00114"></a>00114 <span class="preprocessor"></span><span class="preprocessor">            #define va_end(ap)          ((void)0)</span>
<a name="l00115"></a>00115 <span class="preprocessor"></span>            <span class="comment">/*  little endian */</span>
<a name="l00116"></a>00116 <span class="preprocessor">            #define va_arg(ap, type)    \</span>
<a name="l00117"></a>00117 <span class="preprocessor">                (ap = (__sys_va_list) ((char *)(ap) + __va_rounded_size(type)),  \</span>
<a name="l00118"></a>00118 <span class="preprocessor">                *((type *) (void *) ((char *)(ap) - __va_rounded_size(type))))</span>
<a name="l00119"></a>00119 <span class="preprocessor"></span><span class="preprocessor">        #else</span>
<a name="l00120"></a>00120 <span class="preprocessor"></span>            <span class="keyword">typedef</span> __builtin_va_list   __gnuc_va_list;
<a name="l00121"></a>00121             <span class="keyword">typedef</span> __gnuc_va_list      va_list;
<a name="l00122"></a>00122 <span class="preprocessor">            #define va_start(v,l)       __builtin_va_start(v,l)</span>
<a name="l00123"></a>00123 <span class="preprocessor"></span><span class="preprocessor">            #define va_end(v)           __builtin_va_end(v)</span>
<a name="l00124"></a>00124 <span class="preprocessor"></span><span class="preprocessor">            #define va_arg(v,l)         __builtin_va_arg(v,l)</span>
<a name="l00125"></a>00125 <span class="preprocessor"></span><span class="preprocessor">        #endif</span>
<a name="l00126"></a>00126 <span class="preprocessor"></span><span class="preprocessor">    #endif</span>
<a name="l00127"></a>00127 <span class="preprocessor"></span>
<a name="l00128"></a>00128 <span class="preprocessor">    #define SECTION(x)                  __attribute__((section(x)))</span>
<a name="l00129"></a>00129 <span class="preprocessor"></span><span class="preprocessor">    #define UNUSED                      __attribute__((unused))</span>
<a name="l00130"></a>00130 <span class="preprocessor"></span><span class="preprocessor">    #define ALIGN(n)                    __attribute__((aligned(n)))</span>
<a name="l00131"></a>00131 <span class="preprocessor"></span><span class="preprocessor">    #define rt_inline                   static __inline</span>
<a name="l00132"></a>00132 <span class="preprocessor"></span><span class="preprocessor">    #define RTT_API</span>
<a name="l00133"></a>00133 <span class="preprocessor"></span><span class="preprocessor">#elif defined (__ADSPBLACKFIN__)        </span><span class="comment">/* for VisualDSP++ Compiler */</span>
<a name="l00134"></a>00134 <span class="preprocessor">    #include &lt;stdarg.h&gt;</span>
<a name="l00135"></a>00135 <span class="preprocessor">    #define SECTION(x)                  __attribute__((section(x)))</span>
<a name="l00136"></a>00136 <span class="preprocessor"></span><span class="preprocessor">    #define UNUSED                      __attribute__((unused))</span>
<a name="l00137"></a>00137 <span class="preprocessor"></span><span class="preprocessor">    #define ALIGN(n)                    __attribute__((aligned(n)))</span>
<a name="l00138"></a>00138 <span class="preprocessor"></span><span class="preprocessor">    #define rt_inline                   static inline</span>
<a name="l00139"></a>00139 <span class="preprocessor"></span><span class="preprocessor">    #define RTT_API </span>
<a name="l00140"></a>00140 <span class="preprocessor"></span><span class="preprocessor">#elif defined (_MSC_VER)</span>
<a name="l00141"></a>00141 <span class="preprocessor"></span><span class="preprocessor">    #include &lt;stdarg.h&gt;</span>
<a name="l00142"></a>00142 <span class="preprocessor">    #define SECTION(x)</span>
<a name="l00143"></a>00143 <span class="preprocessor"></span><span class="preprocessor">    #define UNUSED</span>
<a name="l00144"></a>00144 <span class="preprocessor"></span><span class="preprocessor">    #define ALIGN(n)                    __declspec(align(n))</span>
<a name="l00145"></a>00145 <span class="preprocessor"></span><span class="preprocessor">    #define rt_inline                   static __inline</span>
<a name="l00146"></a>00146 <span class="preprocessor"></span><span class="preprocessor">    #define RTT_API</span>
<a name="l00147"></a>00147 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00148"></a>00148 <span class="preprocessor"></span>
<a name="l00149"></a>00149 <span class="comment">/* event length */</span>
<a name="l00150"></a>00150 <span class="preprocessor">#define RT_EVENT_LENGTH                 32</span>
<a name="l00151"></a>00151 <span class="preprocessor"></span>
<a name="l00152"></a>00152 <span class="comment">/* memory management option */</span>
<a name="l00153"></a>00153 <span class="preprocessor">#define RT_MM_PAGE_SIZE                 4096</span>
<a name="l00154"></a>00154 <span class="preprocessor"></span><span class="preprocessor">#define RT_MM_PAGE_MASK                 (RT_MM_PAGE_SIZE - 1)</span>
<a name="l00155"></a>00155 <span class="preprocessor"></span><span class="preprocessor">#define RT_MM_PAGE_BITS                 12</span>
<a name="l00156"></a>00156 <span class="preprocessor"></span>
<a name="l00162"></a>00162 
<a name="l00163"></a>00163 <span class="comment">/* RT-Thread error code definitions */</span>
<a name="l00164"></a><a class="code" href="group__Error.html#gaaaddfb31f867cc924e0220470aaaec5f">00164</a> <span class="preprocessor">#define RT_EOK                          0               </span>
<a name="l00165"></a><a class="code" href="group__Error.html#ga00349f5e8b688f0d04b88326ebbf7148">00165</a> <span class="preprocessor">#define RT_ERROR                        1               </span>
<a name="l00166"></a><a class="code" href="group__Error.html#ga4bf14759709bbad38b3af44d0ac5b550">00166</a> <span class="preprocessor">#define RT_ETIMEOUT                     2               </span>
<a name="l00167"></a><a class="code" href="group__Error.html#ga6510144340be8d6b0ec72c4b60ab4219">00167</a> <span class="preprocessor">#define RT_EFULL                        3               </span>
<a name="l00168"></a><a class="code" href="group__Error.html#gaaac90957b823ffc303a4d3a00f39ce6a">00168</a> <span class="preprocessor">#define RT_EEMPTY                       4               </span>
<a name="l00169"></a><a class="code" href="group__Error.html#ga39afdfff046d9cf8c62d92beca8b572f">00169</a> <span class="preprocessor">#define RT_ENOMEM                       5               </span>
<a name="l00170"></a><a class="code" href="group__Error.html#gaa7a65ad3f8153cfac2ba087a3f58f6fa">00170</a> <span class="preprocessor">#define RT_ENOSYS                       6               </span>
<a name="l00171"></a><a class="code" href="group__Error.html#ga94b79af35e40c9cc97e39292aa59d841">00171</a> <span class="preprocessor">#define RT_EBUSY                        7               </span>
<a name="l00172"></a><a class="code" href="group__Error.html#ga4e6d153e65d54083ee2e7f7108554859">00172</a> <span class="preprocessor">#define RT_EIO                          8               </span>
<a name="l00175"></a>00175 <span class="preprocessor"></span>
<a name="l00176"></a>00176 <span class="preprocessor"></span>
<a name="l00183"></a><a class="code" href="group__BasicDef.html#ga8e803706fb0e206869f5f706c1289949">00183</a> <span class="preprocessor">#define RT_ALIGN(size, align)           (((size) + (align) - 1) &amp; ~((align) - 1))</span>
<a name="l00184"></a>00184 <span class="preprocessor"></span>
<a name="l00192"></a><a class="code" href="group__BasicDef.html#gadf0d0c14b78871331bac6701d7ee6e42">00192</a> <span class="preprocessor">#define RT_ALIGN_DOWN(size, align)      ((size) &amp; ~((align) - 1))</span>
<a name="l00193"></a>00193 <span class="preprocessor"></span>
<a name="l00200"></a><a class="code" href="group__BasicDef.html#gab3633bbb2a09b3406b19463ffc634345">00200</a> <span class="preprocessor">#define RT_NULL                         (0)</span>
<a name="l00201"></a>00201 <span class="preprocessor"></span>
<a name="l00202"></a><a class="code" href="structrt__list__node.html">00202</a> <span class="keyword">struct </span><a class="code" href="structrt__list__node.html">rt_list_node</a>
<a name="l00203"></a>00203 {
<a name="l00204"></a><a class="code" href="structrt__list__node.html#a50efb4b80ce8a9b46fb3a0e367d60817">00204</a>     <span class="keyword">struct </span><a class="code" href="structrt__list__node.html">rt_list_node</a> *<a class="code" href="structrt__list__node.html#a50efb4b80ce8a9b46fb3a0e367d60817">next</a>;                          
<a name="l00205"></a><a class="code" href="structrt__list__node.html#ab86c797b257b99746ccad6a733c06d38">00205</a>     <span class="keyword">struct </span><a class="code" href="structrt__list__node.html">rt_list_node</a> *<a class="code" href="structrt__list__node.html#ab86c797b257b99746ccad6a733c06d38">prev</a>;                          
<a name="l00206"></a>00206 };
<a name="l00207"></a>00207 <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structrt__list__node.html">rt_list_node</a> <a class="code" href="structrt__list__node.html">rt_list_t</a>;                  
<a name="l00214"></a>00214 
<a name="l00215"></a>00215 <span class="comment">/*</span>
<a name="l00216"></a>00216 <span class="comment"> * kernel object macros</span>
<a name="l00217"></a>00217 <span class="comment"> */</span>
<a name="l00218"></a><a class="code" href="group__KernelObject.html#gadc83c17483bce09fad91cc8b2a3d0ed5">00218</a> <span class="preprocessor">#define RT_OBJECT_FLAG_MODULE           0x80            </span>
<a name="l00223"></a><a class="code" href="structrt__object.html">00223</a> <span class="preprocessor">struct rt_object</span>
<a name="l00224"></a>00224 <span class="preprocessor"></span>{
<a name="l00225"></a><a class="code" href="structrt__object.html#a2546fe32b051c21668f5946e05de77cc">00225</a>     <span class="keywordtype">char</span>       name[RT_NAME_MAX];                       
<a name="l00226"></a><a class="code" href="structrt__object.html#a87fff935df5a56027657597120071149">00226</a>     rt_uint8_t type;                                    
<a name="l00227"></a><a class="code" href="structrt__object.html#aa2b7be2eb353a54b8319ae285fff23f4">00227</a>     rt_uint8_t flag;                                    
<a name="l00229"></a>00229 <span class="preprocessor">#ifdef RT_USING_MODULE</span>
<a name="l00230"></a>00230 <span class="preprocessor"></span>    <span class="keywordtype">void</span>      *module_id;                               
<a name="l00231"></a>00231 <span class="preprocessor">#endif</span>
<a name="l00232"></a><a class="code" href="structrt__object.html#a69dc994d5641cee2afddb6cf1b737405">00232</a> <span class="preprocessor"></span>    <a class="code" href="structrt__list__node.html">rt_list_t</a>  list;                                    
<a name="l00233"></a>00233 };
<a name="l00234"></a><a class="code" href="group__KernelObject.html#ga91d74b4f1699da278153af455dadcd70">00234</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structrt__object.html">rt_object</a> *<a class="code" href="structrt__object.html">rt_object_t</a>;                  
<a name="l00253"></a><a class="code" href="group__KernelObject.html#ga38a532bcb1bd3f12685db4219b761b56">00253</a> <span class="keyword">enum</span> <a class="code" href="group__KernelObject.html#ga38a532bcb1bd3f12685db4219b761b56">rt_object_class_type</a>
<a name="l00254"></a>00254 {
<a name="l00255"></a><a class="code" href="group__KernelObject.html#gga38a532bcb1bd3f12685db4219b761b56a548d26bb698e083d38bd8f0649441a52">00255</a>     <a class="code" href="group__KernelObject.html#gga38a532bcb1bd3f12685db4219b761b56a548d26bb698e083d38bd8f0649441a52">RT_Object_Class_Thread</a> = 0,                         
<a name="l00256"></a>00256 <span class="preprocessor">#ifdef RT_USING_SEMAPHORE</span>
<a name="l00257"></a>00257 <span class="preprocessor"></span>    RT_Object_Class_Semaphore,                          
<a name="l00258"></a>00258 <span class="preprocessor">#endif</span>
<a name="l00259"></a>00259 <span class="preprocessor"></span><span class="preprocessor">#ifdef RT_USING_MUTEX</span>
<a name="l00260"></a>00260 <span class="preprocessor"></span>    RT_Object_Class_Mutex,                              
<a name="l00261"></a>00261 <span class="preprocessor">#endif</span>
<a name="l00262"></a>00262 <span class="preprocessor"></span><span class="preprocessor">#ifdef RT_USING_EVENT</span>
<a name="l00263"></a>00263 <span class="preprocessor"></span>    RT_Object_Class_Event,                              
<a name="l00264"></a>00264 <span class="preprocessor">#endif</span>
<a name="l00265"></a>00265 <span class="preprocessor"></span><span class="preprocessor">#ifdef RT_USING_MAILBOX</span>
<a name="l00266"></a>00266 <span class="preprocessor"></span>    RT_Object_Class_MailBox,                            
<a name="l00267"></a>00267 <span class="preprocessor">#endif</span>
<a name="l00268"></a>00268 <span class="preprocessor"></span><span class="preprocessor">#ifdef RT_USING_MESSAGEQUEUE</span>
<a name="l00269"></a>00269 <span class="preprocessor"></span>    RT_Object_Class_MessageQueue,                       
<a name="l00270"></a>00270 <span class="preprocessor">#endif</span>
<a name="l00271"></a>00271 <span class="preprocessor"></span><span class="preprocessor">#ifdef RT_USING_MEMHEAP</span>
<a name="l00272"></a>00272 <span class="preprocessor"></span>    RT_Object_Class_MemHeap,                            
<a name="l00273"></a>00273 <span class="preprocessor">#endif</span>
<a name="l00274"></a>00274 <span class="preprocessor"></span><span class="preprocessor">#ifdef RT_USING_MEMPOOL</span>
<a name="l00275"></a>00275 <span class="preprocessor"></span>    RT_Object_Class_MemPool,                            
<a name="l00276"></a>00276 <span class="preprocessor">#endif</span>
<a name="l00277"></a>00277 <span class="preprocessor"></span><span class="preprocessor">#ifdef RT_USING_DEVICE</span>
<a name="l00278"></a>00278 <span class="preprocessor"></span>    RT_Object_Class_Device,                             
<a name="l00279"></a>00279 <span class="preprocessor">#endif</span>
<a name="l00280"></a><a class="code" href="group__KernelObject.html#gga38a532bcb1bd3f12685db4219b761b56a29bccdc3303ac04a7e25d40fea97ab12">00280</a> <span class="preprocessor"></span>    <a class="code" href="group__KernelObject.html#gga38a532bcb1bd3f12685db4219b761b56a29bccdc3303ac04a7e25d40fea97ab12">RT_Object_Class_Timer</a>,                              
<a name="l00281"></a>00281 <span class="preprocessor">#ifdef RT_USING_MODULE</span>
<a name="l00282"></a>00282 <span class="preprocessor"></span>    RT_Object_Class_Module,                             
<a name="l00283"></a>00283 <span class="preprocessor">#endif</span>
<a name="l00284"></a><a class="code" href="group__KernelObject.html#gga38a532bcb1bd3f12685db4219b761b56a7fd1d3fe31dd8000703a6198bd919c74">00284</a> <span class="preprocessor"></span>    <a class="code" href="group__KernelObject.html#gga38a532bcb1bd3f12685db4219b761b56a7fd1d3fe31dd8000703a6198bd919c74">RT_Object_Class_Unknown</a>,                            
<a name="l00285"></a><a class="code" href="group__KernelObject.html#gga38a532bcb1bd3f12685db4219b761b56ac3a51281d7f8fee902e6324673d39cec">00285</a>     <a class="code" href="group__KernelObject.html#gga38a532bcb1bd3f12685db4219b761b56ac3a51281d7f8fee902e6324673d39cec">RT_Object_Class_Static</a> = 0x80                       
<a name="l00286"></a>00286 };
<a name="l00287"></a>00287 
<a name="l00291"></a><a class="code" href="structrt__object__information.html">00291</a> <span class="keyword">struct </span><a class="code" href="structrt__object__information.html">rt_object_information</a>
<a name="l00292"></a>00292 {
<a name="l00293"></a><a class="code" href="structrt__object__information.html#ade4fad90f69638200ccb2cbcc9f8e298">00293</a>     <span class="keyword">enum</span> <a class="code" href="group__KernelObject.html#ga38a532bcb1bd3f12685db4219b761b56">rt_object_class_type</a> <a class="code" href="structrt__object__information.html#ade4fad90f69638200ccb2cbcc9f8e298">type</a>;                     
<a name="l00294"></a><a class="code" href="structrt__object__information.html#ad201bcecb2a95d3516b06e020ec24e73">00294</a>     <a class="code" href="structrt__list__node.html">rt_list_t</a>                 <a class="code" href="structrt__object__information.html#ad201bcecb2a95d3516b06e020ec24e73">object_list</a>;              
<a name="l00295"></a><a class="code" href="structrt__object__information.html#ada7e29b16c914f1692557fdc98f471fc">00295</a>     rt_size_t                 <a class="code" href="structrt__object__information.html#ada7e29b16c914f1692557fdc98f471fc">object_size</a>;              
<a name="l00296"></a>00296 };
<a name="l00297"></a>00297 
<a name="l00301"></a>00301 <span class="preprocessor">#ifdef RT_USING_HOOK</span>
<a name="l00302"></a>00302 <span class="preprocessor"></span><span class="preprocessor">#define RT_OBJECT_HOOK_CALL(func, argv) \</span>
<a name="l00303"></a>00303 <span class="preprocessor">    do { if ((func) != RT_NULL) func argv; } while (0)</span>
<a name="l00304"></a>00304 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00305"></a><a class="code" href="group__KernelObject.html#ga40f88eaca0029aea304a7757c85431b8">00305</a> <span class="preprocessor"></span><span class="preprocessor">#define RT_OBJECT_HOOK_CALL(func, argv) </span>
<a name="l00306"></a>00306 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00307"></a>00307 <span class="preprocessor"></span>
<a name="l00315"></a>00315 
<a name="l00319"></a><a class="code" href="group__Clock.html#gaf00c192dcbc7a949beebaec8e8bf9232">00319</a> <span class="preprocessor">#define RT_TIMER_FLAG_DEACTIVATED       0x0             </span>
<a name="l00320"></a><a class="code" href="group__Clock.html#ga174b5f60b760b5e421616ff17cb15c4b">00320</a> <span class="preprocessor">#define RT_TIMER_FLAG_ACTIVATED         0x1             </span>
<a name="l00321"></a><a class="code" href="group__Clock.html#gae9ef5d12543ac6b2113741ed503fc9c3">00321</a> <span class="preprocessor">#define RT_TIMER_FLAG_ONE_SHOT          0x0             </span>
<a name="l00322"></a><a class="code" href="group__Clock.html#ga52a9fd903938762a98408771bd139097">00322</a> <span class="preprocessor">#define RT_TIMER_FLAG_PERIODIC          0x2             </span>
<a name="l00324"></a><a class="code" href="group__Clock.html#gad750e1e3947c267e57be487dad3b4300">00324</a> <span class="preprocessor">#define RT_TIMER_FLAG_HARD_TIMER        0x0             </span>
<a name="l00325"></a><a class="code" href="group__Clock.html#ga0df6e547917d460610fd734ae84daca3">00325</a> <span class="preprocessor">#define RT_TIMER_FLAG_SOFT_TIMER        0x4             </span>
<a name="l00327"></a><a class="code" href="group__Clock.html#ga9b1d12b8471acff4c8f9eebb4216c7df">00327</a> <span class="preprocessor">#define RT_TIMER_CTRL_SET_TIME          0x0             </span>
<a name="l00328"></a><a class="code" href="group__Clock.html#ga2bbc0b4b2a4914c8eea4d1263e52ab85">00328</a> <span class="preprocessor">#define RT_TIMER_CTRL_GET_TIME          0x1             </span>
<a name="l00329"></a><a class="code" href="group__Clock.html#ga460a57e7d4fe4ea24772affaca3d62bc">00329</a> <span class="preprocessor">#define RT_TIMER_CTRL_SET_ONESHOT       0x2             </span>
<a name="l00330"></a><a class="code" href="group__Clock.html#ga2e125a6714e6a5ff5756129cadbe3a7d">00330</a> <span class="preprocessor">#define RT_TIMER_CTRL_SET_PERIODIC      0x3             </span>
<a name="l00335"></a><a class="code" href="structrt__timer.html">00335</a> <span class="preprocessor">struct rt_timer</span>
<a name="l00336"></a>00336 <span class="preprocessor"></span>{
<a name="l00337"></a><a class="code" href="structrt__timer.html#a1a3b0ccd5039808ff180c0507812d629">00337</a>     <span class="keyword">struct </span><a class="code" href="structrt__object.html">rt_object</a> parent;                            
<a name="l00339"></a><a class="code" href="structrt__timer.html#a219547fa3ec08aeedb474a5795165946">00339</a>     <a class="code" href="structrt__list__node.html">rt_list_t</a>        <a class="code" href="structrt__object.html#a69dc994d5641cee2afddb6cf1b737405">list</a>;                              
<a name="l00341"></a><a class="code" href="structrt__timer.html#a99212839ec394738c375a4d55d835e16">00341</a>     void (*timeout_func)(<span class="keywordtype">void</span> *parameter);              
<a name="l00342"></a><a class="code" href="structrt__timer.html#a7865afa39d2596876ce1e7c3275c9042">00342</a>     <span class="keywordtype">void</span>            *parameter;                         
<a name="l00344"></a><a class="code" href="structrt__timer.html#af958eb6ee48462b264972242f9b6d9c3">00344</a>     rt_tick_t        init_tick;                         
<a name="l00345"></a><a class="code" href="structrt__timer.html#afc375a971b021a1c75a6fba94742b136">00345</a>     rt_tick_t        timeout_tick;                      
<a name="l00346"></a>00346 };
<a name="l00347"></a>00347 <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structrt__timer.html">rt_timer</a> *<a class="code" href="structrt__timer.html">rt_timer_t</a>;
<a name="l00348"></a>00348 
<a name="l00356"></a>00356 
<a name="l00357"></a>00357 <span class="comment">/*</span>
<a name="l00358"></a>00358 <span class="comment"> * Thread</span>
<a name="l00359"></a>00359 <span class="comment"> */</span>
<a name="l00360"></a>00360 
<a name="l00361"></a>00361 <span class="comment">/*</span>
<a name="l00362"></a>00362 <span class="comment"> * thread state definitions</span>
<a name="l00363"></a>00363 <span class="comment"> */</span>
<a name="l00364"></a><a class="code" href="group__Thread.html#gae743a0f57a34ce46c0687ff787972ded">00364</a> <span class="preprocessor">#define RT_THREAD_INIT                  0x00                </span>
<a name="l00365"></a><a class="code" href="group__Thread.html#ga3d2482a36a666c7e796f0fee67c0d3f3">00365</a> <span class="preprocessor">#define RT_THREAD_READY                 0x01                </span>
<a name="l00366"></a><a class="code" href="group__Thread.html#gad67bab390563b8b80a2ee7a847660f85">00366</a> <span class="preprocessor">#define RT_THREAD_SUSPEND               0x02                </span>
<a name="l00367"></a><a class="code" href="group__Thread.html#ga76fc51507d2201f644b94b916560778b">00367</a> <span class="preprocessor">#define RT_THREAD_RUNNING               0x03                </span>
<a name="l00368"></a><a class="code" href="group__Thread.html#ga85729ec69f5f51133e5d1e218f1bd504">00368</a> <span class="preprocessor">#define RT_THREAD_BLOCK                 RT_THREAD_SUSPEND   </span>
<a name="l00369"></a><a class="code" href="group__Thread.html#ga1c39773ce3aefe35d15e68f34ddedc9a">00369</a> <span class="preprocessor">#define RT_THREAD_CLOSE                 0x04                </span>
<a name="l00374"></a><a class="code" href="group__Thread.html#gae94f55354bd0e145bd855bd38db5c442">00374</a> <span class="preprocessor">#define RT_THREAD_CTRL_STARTUP          0x00                </span>
<a name="l00375"></a><a class="code" href="group__Thread.html#gad875eaaa2400aef8f6078f5d1f8297b3">00375</a> <span class="preprocessor">#define RT_THREAD_CTRL_CLOSE            0x01                </span>
<a name="l00376"></a><a class="code" href="group__Thread.html#gad59e5c8ec96f8b3231947b0c665e5fba">00376</a> <span class="preprocessor">#define RT_THREAD_CTRL_CHANGE_PRIORITY  0x02                </span>
<a name="l00377"></a><a class="code" href="group__Thread.html#ga45ba1445796c920c2ae943b419e19d4b">00377</a> <span class="preprocessor">#define RT_THREAD_CTRL_INFO             0x03                </span>
<a name="l00382"></a><a class="code" href="structrt__thread.html">00382</a> <span class="preprocessor">struct rt_thread</span>
<a name="l00383"></a>00383 <span class="preprocessor"></span>{
<a name="l00384"></a>00384     <span class="comment">/* rt object */</span>
<a name="l00385"></a><a class="code" href="structrt__thread.html#a89b5c7fb22abb868056586e365b3fbd3">00385</a>     <span class="keywordtype">char</span>        name[RT_NAME_MAX];                      
<a name="l00386"></a><a class="code" href="structrt__thread.html#a9e66117dc5b76db6d0d78aa3077b57da">00386</a>     rt_uint8_t  type;                                   
<a name="l00387"></a><a class="code" href="structrt__thread.html#a0a62e2cba8609469b351472d615fd326">00387</a>     rt_uint8_t  flags;                                  
<a name="l00389"></a>00389 <span class="preprocessor">#ifdef RT_USING_MODULE</span>
<a name="l00390"></a>00390 <span class="preprocessor"></span>    <span class="keywordtype">void</span>       *module_id;                              
<a name="l00391"></a>00391 <span class="preprocessor">#endif</span>
<a name="l00392"></a>00392 <span class="preprocessor"></span>
<a name="l00393"></a><a class="code" href="structrt__thread.html#a30dd781aa72ce771beef5ed7a4cdbbd7">00393</a>     <a class="code" href="structrt__list__node.html">rt_list_t</a>   <a class="code" href="structrt__timer.html#a219547fa3ec08aeedb474a5795165946">list</a>;                                   
<a name="l00394"></a><a class="code" href="structrt__thread.html#a8484a36933357e7c6f871364d9f2d3a9">00394</a>     <a class="code" href="structrt__list__node.html">rt_list_t</a>   tlist;                                  
<a name="l00396"></a>00396     <span class="comment">/* stack point and entry */</span>
<a name="l00397"></a><a class="code" href="structrt__thread.html#abc9d01c30e0fc9872df2fd5c044e31e0">00397</a>     <span class="keywordtype">void</span>       *sp;                                     
<a name="l00398"></a><a class="code" href="structrt__thread.html#adcdaf75f05998c6485544c337526da52">00398</a>     <span class="keywordtype">void</span>       *entry;                                  
<a name="l00399"></a><a class="code" href="structrt__thread.html#a153b0810eaeb3c0508f3fdc9027a301e">00399</a>     <span class="keywordtype">void</span>       *<a class="code" href="structrt__timer.html#a7865afa39d2596876ce1e7c3275c9042">parameter</a>;                              
<a name="l00400"></a><a class="code" href="structrt__thread.html#a2bb90555aaff4a54699c88c2789e0407">00400</a>     <span class="keywordtype">void</span>       *stack_addr;                             
<a name="l00401"></a><a class="code" href="structrt__thread.html#a08915cf4c568a17fb73b938c82f9cf25">00401</a>     rt_uint16_t stack_size;                             
<a name="l00403"></a>00403     <span class="comment">/* error code */</span>
<a name="l00404"></a><a class="code" href="structrt__thread.html#a32eec53f34cb610335b085a642e6e995">00404</a>     rt_err_t    error;                                  
<a name="l00406"></a><a class="code" href="structrt__thread.html#a16a3dd776f8cfed732deda73535dbb00">00406</a>     rt_uint8_t  stat;                                   
<a name="l00408"></a>00408     <span class="comment">/* priority */</span>
<a name="l00409"></a><a class="code" href="structrt__thread.html#a90875799a0ea47e5558f104702a20548">00409</a>     rt_uint8_t  current_priority;                       
<a name="l00410"></a><a class="code" href="structrt__thread.html#a281785b80ad0dc2e7d0c5404d32c67f9">00410</a>     rt_uint8_t  init_priority;                          
<a name="l00411"></a>00411 <span class="preprocessor">#if RT_THREAD_PRIORITY_MAX &gt; 32</span>
<a name="l00412"></a>00412 <span class="preprocessor"></span>    rt_uint8_t  number;
<a name="l00413"></a>00413     rt_uint8_t  high_mask;
<a name="l00414"></a>00414 <span class="preprocessor">#endif</span>
<a name="l00415"></a>00415 <span class="preprocessor"></span>    rt_uint32_t number_mask;
<a name="l00416"></a>00416 
<a name="l00417"></a>00417 <span class="preprocessor">#if defined(RT_USING_EVENT)</span>
<a name="l00418"></a>00418 <span class="preprocessor"></span>    <span class="comment">/* thread event */</span>
<a name="l00419"></a>00419     rt_uint32_t event_set;
<a name="l00420"></a>00420     rt_uint8_t  event_info;
<a name="l00421"></a>00421 <span class="preprocessor">#endif</span>
<a name="l00422"></a>00422 <span class="preprocessor"></span>
<a name="l00423"></a><a class="code" href="structrt__thread.html#a3da450b626778b5cf1125174783c1989">00423</a>     rt_ubase_t  <a class="code" href="structrt__timer.html#af958eb6ee48462b264972242f9b6d9c3">init_tick</a>;                              
<a name="l00424"></a><a class="code" href="structrt__thread.html#a763db3299b6a4c69ad7aa5b7815f3daf">00424</a>     rt_ubase_t  remaining_tick;                         
<a name="l00426"></a><a class="code" href="structrt__thread.html#ac787f3fbcdc5f8d012f2d6d9923f5560">00426</a>     <span class="keyword">struct </span><a class="code" href="structrt__timer.html">rt_timer</a> thread_timer;                       
<a name="l00428"></a><a class="code" href="structrt__thread.html#ac7c6d56c56677160b3c651571bcb127a">00428</a>     void (*cleanup)(<span class="keyword">struct </span><a class="code" href="structrt__thread.html">rt_thread</a> *tid);             
<a name="l00430"></a><a class="code" href="structrt__thread.html#ad237699b29310d61d8d709253782372b">00430</a>     rt_uint32_t <a class="code" href="structrt__thread.html#ad237699b29310d61d8d709253782372b">user_data</a>;                              
<a name="l00431"></a>00431 };
<a name="l00432"></a>00432 <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structrt__thread.html">rt_thread</a> *<a class="code" href="structrt__thread.html">rt_thread_t</a>;
<a name="l00433"></a>00433 
<a name="l00441"></a>00441 
<a name="l00445"></a><a class="code" href="group__IPC.html#ga1b618f6714ea8f49a45ea4d105aaf5d5">00445</a> <span class="preprocessor">#define RT_IPC_FLAG_FIFO                0x00            </span>
<a name="l00446"></a><a class="code" href="group__IPC.html#ga296aeeb69fe2c8c5012e1059df4364a6">00446</a> <span class="preprocessor">#define RT_IPC_FLAG_PRIO                0x01            </span>
<a name="l00448"></a><a class="code" href="group__IPC.html#gae7ea862e2d1edce01e015bdffe49d586">00448</a> <span class="preprocessor">#define RT_IPC_CMD_UNKNOWN              0x00            </span>
<a name="l00449"></a><a class="code" href="group__IPC.html#ga947606ce2a31a2d70e287c38a09dab3b">00449</a> <span class="preprocessor">#define RT_IPC_CMD_RESET                0x01            </span>
<a name="l00451"></a><a class="code" href="group__IPC.html#ga923d8e409f9daa8843978d6805ebcdeb">00451</a> <span class="preprocessor">#define RT_WAITING_FOREVER              -1              </span>
<a name="l00452"></a><a class="code" href="group__IPC.html#ga78a487898fe750a9f7e9c37911fbe7cb">00452</a> <span class="preprocessor">#define RT_WAITING_NO                   0               </span>
<a name="l00457"></a><a class="code" href="structrt__ipc__object.html">00457</a> <span class="preprocessor">struct rt_ipc_object</span>
<a name="l00458"></a>00458 <span class="preprocessor"></span>{
<a name="l00459"></a><a class="code" href="structrt__ipc__object.html#a1113d054268319ad7840b3362eba7ad2">00459</a>     <span class="keyword">struct </span><a class="code" href="structrt__object.html">rt_object</a> parent;                            
<a name="l00461"></a><a class="code" href="structrt__ipc__object.html#a6b016bc028f03601f1a8efd0fb0e91e2">00461</a>     <a class="code" href="structrt__list__node.html">rt_list_t</a>        suspend_thread;                    
<a name="l00462"></a>00462 };
<a name="l00463"></a>00463 
<a name="l00464"></a>00464 <span class="preprocessor">#ifdef RT_USING_SEMAPHORE</span>
<a name="l00465"></a>00465 <span class="preprocessor"></span>
<a name="l00468"></a>00468 <span class="keyword">struct </span>rt_semaphore
<a name="l00469"></a>00469 {
<a name="l00470"></a>00470     <span class="keyword">struct </span><a class="code" href="structrt__ipc__object.html">rt_ipc_object</a> parent;                        
<a name="l00472"></a>00472     rt_uint16_t          value;                         
<a name="l00473"></a>00473 };
<a name="l00474"></a>00474 <span class="keyword">typedef</span> <span class="keyword">struct </span>rt_semaphore *rt_sem_t;
<a name="l00475"></a>00475 <span class="preprocessor">#endif</span>
<a name="l00476"></a>00476 <span class="preprocessor"></span>
<a name="l00477"></a>00477 <span class="preprocessor">#ifdef RT_USING_MUTEX</span>
<a name="l00478"></a>00478 <span class="preprocessor"></span>
<a name="l00481"></a>00481 <span class="keyword">struct </span>rt_mutex
<a name="l00482"></a>00482 {
<a name="l00483"></a>00483     <span class="keyword">struct </span><a class="code" href="structrt__ipc__object.html">rt_ipc_object</a> <a class="code" href="structrt__ipc__object.html#a1113d054268319ad7840b3362eba7ad2">parent</a>;                        
<a name="l00485"></a>00485     rt_uint16_t          value;                         
<a name="l00487"></a>00487     rt_uint8_t           original_priority;             
<a name="l00488"></a>00488     rt_uint8_t           hold;                          
<a name="l00490"></a>00490     <span class="keyword">struct </span><a class="code" href="structrt__thread.html">rt_thread</a>    *owner;                         
<a name="l00491"></a>00491 };
<a name="l00492"></a>00492 <span class="keyword">typedef</span> <span class="keyword">struct </span>rt_mutex *rt_mutex_t;
<a name="l00493"></a>00493 <span class="preprocessor">#endif</span>
<a name="l00494"></a>00494 <span class="preprocessor"></span>
<a name="l00495"></a>00495 <span class="preprocessor">#ifdef RT_USING_EVENT</span>
<a name="l00496"></a>00496 <span class="preprocessor"></span>
<a name="l00499"></a>00499 <span class="preprocessor">#define RT_EVENT_FLAG_AND               0x01            </span>
<a name="l00500"></a>00500 <span class="preprocessor">#define RT_EVENT_FLAG_OR                0x02            </span>
<a name="l00501"></a>00501 <span class="preprocessor">#define RT_EVENT_FLAG_CLEAR             0x04            </span>
<a name="l00503"></a>00503 <span class="preprocessor"></span><span class="comment">/*</span>
<a name="l00504"></a>00504 <span class="comment"> * event structure</span>
<a name="l00505"></a>00505 <span class="comment"> */</span>
<a name="l00506"></a>00506 <span class="keyword">struct </span>rt_event
<a name="l00507"></a>00507 {
<a name="l00508"></a>00508     <span class="keyword">struct </span><a class="code" href="structrt__ipc__object.html">rt_ipc_object</a> <a class="code" href="structrt__ipc__object.html#a1113d054268319ad7840b3362eba7ad2">parent</a>;                        
<a name="l00510"></a>00510     rt_uint32_t          <span class="keyword">set</span>;                           
<a name="l00511"></a>00511 };
<a name="l00512"></a>00512 <span class="keyword">typedef</span> <span class="keyword">struct </span>rt_event *rt_event_t;
<a name="l00513"></a>00513 <span class="preprocessor">#endif</span>
<a name="l00514"></a>00514 <span class="preprocessor"></span>
<a name="l00515"></a>00515 <span class="preprocessor">#ifdef RT_USING_MAILBOX</span>
<a name="l00516"></a>00516 <span class="preprocessor"></span>
<a name="l00519"></a>00519 <span class="keyword">struct </span>rt_mailbox
<a name="l00520"></a>00520 {
<a name="l00521"></a>00521     <span class="keyword">struct </span><a class="code" href="structrt__ipc__object.html">rt_ipc_object</a> <a class="code" href="structrt__ipc__object.html#a1113d054268319ad7840b3362eba7ad2">parent</a>;                        
<a name="l00523"></a>00523     rt_uint32_t         *msg_pool;                      
<a name="l00525"></a>00525     rt_uint16_t          size;                          
<a name="l00527"></a>00527     rt_uint16_t          entry;                         
<a name="l00528"></a>00528     rt_uint16_t          in_offset;                     
<a name="l00529"></a>00529     rt_uint16_t          out_offset;                    
<a name="l00531"></a>00531     <a class="code" href="structrt__list__node.html">rt_list_t</a>            suspend_sender_thread;         
<a name="l00532"></a>00532 };
<a name="l00533"></a>00533 <span class="keyword">typedef</span> <span class="keyword">struct </span>rt_mailbox *rt_mailbox_t;
<a name="l00534"></a>00534 <span class="preprocessor">#endif</span>
<a name="l00535"></a>00535 <span class="preprocessor"></span>
<a name="l00536"></a>00536 <span class="preprocessor">#ifdef RT_USING_MESSAGEQUEUE</span>
<a name="l00537"></a>00537 <span class="preprocessor"></span>
<a name="l00540"></a>00540 <span class="keyword">struct </span>rt_messagequeue
<a name="l00541"></a>00541 {
<a name="l00542"></a>00542     <span class="keyword">struct </span><a class="code" href="structrt__ipc__object.html">rt_ipc_object</a> <a class="code" href="structrt__ipc__object.html#a1113d054268319ad7840b3362eba7ad2">parent</a>;                        
<a name="l00544"></a>00544     <span class="keywordtype">void</span>                *msg_pool;                      
<a name="l00546"></a>00546     rt_uint16_t          msg_size;                      
<a name="l00547"></a>00547     rt_uint16_t          max_msgs;                      
<a name="l00549"></a>00549     rt_uint16_t          entry;                         
<a name="l00551"></a>00551     <span class="keywordtype">void</span>                *msg_queue_head;                
<a name="l00552"></a>00552     <span class="keywordtype">void</span>                *msg_queue_tail;                
<a name="l00553"></a>00553     <span class="keywordtype">void</span>                *msg_queue_free;                
<a name="l00554"></a>00554 };
<a name="l00555"></a>00555 <span class="keyword">typedef</span> <span class="keyword">struct </span>rt_messagequeue *rt_mq_t;
<a name="l00556"></a>00556 <span class="preprocessor">#endif</span>
<a name="l00557"></a>00557 <span class="preprocessor"></span>
<a name="l00565"></a>00565 
<a name="l00566"></a>00566 <span class="comment">/*</span>
<a name="l00567"></a>00567 <span class="comment"> * memory management</span>
<a name="l00568"></a>00568 <span class="comment"> * heap &amp; partition</span>
<a name="l00569"></a>00569 <span class="comment"> */</span>
<a name="l00570"></a>00570 
<a name="l00571"></a>00571 <span class="preprocessor">#ifdef RT_USING_MEMHEAP</span>
<a name="l00572"></a>00572 <span class="preprocessor"></span>
<a name="l00575"></a>00575 <span class="keyword">struct </span>rt_memheap_item
<a name="l00576"></a>00576 {
<a name="l00577"></a>00577     rt_uint32_t             magic;                      
<a name="l00578"></a>00578     <span class="keyword">struct </span>rt_memheap_item *next;                       
<a name="l00579"></a>00579     <span class="keyword">struct </span>rt_memheap_item *prev;                       
<a name="l00581"></a>00581     <span class="keyword">struct </span>rt_memheap      *pool_ptr;                   
<a name="l00583"></a>00583     <span class="keyword">struct </span>rt_memheap_item *next_free;                  
<a name="l00584"></a>00584     <span class="keyword">struct </span>rt_memheap_item *prev_free;                  
<a name="l00585"></a>00585 };
<a name="l00586"></a>00586 
<a name="l00590"></a>00590 <span class="keyword">struct </span>rt_memheap
<a name="l00591"></a>00591 {
<a name="l00592"></a>00592     <span class="keyword">struct </span><a class="code" href="structrt__object.html">rt_object</a>        parent;                     
<a name="l00594"></a>00594     <span class="keywordtype">void</span>                   *start_addr;                 
<a name="l00596"></a>00596     rt_uint32_t             pool_size;                  
<a name="l00597"></a>00597     rt_uint32_t             available_size;             
<a name="l00598"></a>00598     rt_uint32_t             max_used_size;              
<a name="l00600"></a>00600     <span class="keyword">struct </span>rt_memheap_item *block_list;                 
<a name="l00602"></a>00602     <span class="keyword">struct </span>rt_memheap_item *free_list;                  
<a name="l00603"></a>00603     <span class="keyword">struct </span>rt_memheap_item  free_header;                
<a name="l00605"></a>00605     <span class="keyword">struct </span>rt_semaphore     lock;                       
<a name="l00606"></a>00606 };
<a name="l00607"></a>00607 <span class="preprocessor">#endif</span>
<a name="l00608"></a>00608 <span class="preprocessor"></span>
<a name="l00609"></a>00609 <span class="preprocessor">#ifdef RT_USING_MEMPOOL</span>
<a name="l00610"></a>00610 <span class="preprocessor"></span>
<a name="l00613"></a>00613 <span class="keyword">struct </span>rt_mempool
<a name="l00614"></a>00614 {
<a name="l00615"></a>00615     <span class="keyword">struct </span><a class="code" href="structrt__object.html">rt_object</a> parent;                            
<a name="l00617"></a>00617     <span class="keywordtype">void</span>            *start_address;                     
<a name="l00618"></a>00618     rt_size_t        size;                              
<a name="l00620"></a>00620     rt_size_t        block_size;                        
<a name="l00621"></a>00621     rt_uint8_t      *block_list;                        
<a name="l00623"></a>00623     rt_size_t        block_total_count;                 
<a name="l00624"></a>00624     rt_size_t        block_free_count;                  
<a name="l00626"></a>00626     <a class="code" href="structrt__list__node.html">rt_list_t</a>        suspend_thread;                    
<a name="l00627"></a>00627     rt_size_t        suspend_thread_count;              
<a name="l00628"></a>00628 };
<a name="l00629"></a>00629 <span class="keyword">typedef</span> <span class="keyword">struct </span>rt_mempool *rt_mp_t;
<a name="l00630"></a>00630 <span class="preprocessor">#endif</span>
<a name="l00631"></a>00631 <span class="preprocessor"></span>
<a name="l00634"></a>00634 <span class="preprocessor">#ifdef RT_USING_DEVICE</span>
<a name="l00635"></a>00635 <span class="preprocessor"></span>
<a name="l00640"></a>00640 
<a name="l00644"></a>00644 <span class="keyword">enum</span> rt_device_class_type
<a name="l00645"></a>00645 {
<a name="l00646"></a>00646     RT_Device_Class_Char = 0,                           
<a name="l00647"></a>00647     RT_Device_Class_Block,                              
<a name="l00648"></a>00648     RT_Device_Class_NetIf,                              
<a name="l00649"></a>00649     RT_Device_Class_MTD,                                
<a name="l00650"></a>00650     RT_Device_Class_CAN,                                
<a name="l00651"></a>00651     RT_Device_Class_RTC,                                
<a name="l00652"></a>00652     RT_Device_Class_Sound,                              
<a name="l00653"></a>00653     RT_Device_Class_Graphic,                            
<a name="l00654"></a>00654     RT_Device_Class_I2CBUS,                             
<a name="l00655"></a>00655     RT_Device_Class_USBDevice,                          
<a name="l00656"></a>00656     RT_Device_Class_USBHost,                            
<a name="l00657"></a>00657     RT_Device_Class_SPIBUS,                             
<a name="l00658"></a>00658     RT_Device_Class_SPIDevice,                          
<a name="l00659"></a>00659     RT_Device_Class_SDIO,                               
<a name="l00660"></a>00660     RT_Device_Class_PM,                                 
<a name="l00661"></a>00661     RT_Device_Class_Unknown                             
<a name="l00662"></a>00662 };
<a name="l00663"></a>00663 
<a name="l00667"></a>00667 <span class="preprocessor">#define RT_DEVICE_FLAG_DEACTIVATE       0x000           </span>
<a name="l00669"></a>00669 <span class="preprocessor">#define RT_DEVICE_FLAG_RDONLY           0x001           </span>
<a name="l00670"></a>00670 <span class="preprocessor">#define RT_DEVICE_FLAG_WRONLY           0x002           </span>
<a name="l00671"></a>00671 <span class="preprocessor">#define RT_DEVICE_FLAG_RDWR             0x003           </span>
<a name="l00673"></a>00673 <span class="preprocessor">#define RT_DEVICE_FLAG_REMOVABLE        0x004           </span>
<a name="l00674"></a>00674 <span class="preprocessor">#define RT_DEVICE_FLAG_STANDALONE       0x008           </span>
<a name="l00675"></a>00675 <span class="preprocessor">#define RT_DEVICE_FLAG_ACTIVATED        0x010           </span>
<a name="l00676"></a>00676 <span class="preprocessor">#define RT_DEVICE_FLAG_SUSPENDED        0x020           </span>
<a name="l00677"></a>00677 <span class="preprocessor">#define RT_DEVICE_FLAG_STREAM           0x040           </span>
<a name="l00679"></a>00679 <span class="preprocessor">#define RT_DEVICE_FLAG_INT_RX           0x100           </span>
<a name="l00680"></a>00680 <span class="preprocessor">#define RT_DEVICE_FLAG_DMA_RX           0x200           </span>
<a name="l00681"></a>00681 <span class="preprocessor">#define RT_DEVICE_FLAG_INT_TX           0x400           </span>
<a name="l00682"></a>00682 <span class="preprocessor">#define RT_DEVICE_FLAG_DMA_TX           0x800           </span>
<a name="l00684"></a>00684 <span class="preprocessor">#define RT_DEVICE_OFLAG_CLOSE           0x000           </span>
<a name="l00685"></a>00685 <span class="preprocessor">#define RT_DEVICE_OFLAG_RDONLY          0x001           </span>
<a name="l00686"></a>00686 <span class="preprocessor">#define RT_DEVICE_OFLAG_WRONLY          0x002           </span>
<a name="l00687"></a>00687 <span class="preprocessor">#define RT_DEVICE_OFLAG_RDWR            0x003           </span>
<a name="l00688"></a>00688 <span class="preprocessor">#define RT_DEVICE_OFLAG_OPEN            0x008           </span>
<a name="l00693"></a>00693 <span class="preprocessor">#define RT_DEVICE_CTRL_RESUME           0x01            </span>
<a name="l00694"></a>00694 <span class="preprocessor">#define RT_DEVICE_CTRL_SUSPEND          0x02            </span>
<a name="l00699"></a>00699 <span class="preprocessor">#define RT_DEVICE_CTRL_CHAR_STREAM      0x10            </span>
<a name="l00700"></a>00700 <span class="preprocessor">#define RT_DEVICE_CTRL_BLK_GETGEOME     0x10            </span>
<a name="l00701"></a>00701 <span class="preprocessor">#define RT_DEVICE_CTRL_BLK_SYNC         0x11            </span>
<a name="l00702"></a>00702 <span class="preprocessor">#define RT_DEVICE_CTRL_BLK_ERASE        0x12            </span>
<a name="l00703"></a>00703 <span class="preprocessor">#define RT_DEVICE_CTRL_NETIF_GETMAC     0x10            </span>
<a name="l00704"></a>00704 <span class="preprocessor">#define RT_DEVICE_CTRL_MTD_FORMAT       0x10            </span>
<a name="l00705"></a>00705 <span class="preprocessor">#define RT_DEVICE_CTRL_RTC_GET_TIME     0x10            </span>
<a name="l00706"></a>00706 <span class="preprocessor">#define RT_DEVICE_CTRL_RTC_SET_TIME     0x11            </span>
<a name="l00707"></a>00707 <span class="preprocessor">#define RT_DEVICE_CTRL_RTC_GET_ALARM    0x12            </span>
<a name="l00708"></a>00708 <span class="preprocessor">#define RT_DEVICE_CTRL_RTC_SET_ALARM    0x13            </span>
<a name="l00710"></a>00710 <span class="preprocessor">typedef struct rt_device *rt_device_t;</span>
<a name="l00711"></a>00711 <span class="preprocessor"></span>
<a name="l00714"></a>00714 <span class="keyword">struct </span>rt_device
<a name="l00715"></a>00715 {
<a name="l00716"></a>00716     <span class="keyword">struct </span><a class="code" href="structrt__object.html">rt_object</a>          parent;                   
<a name="l00718"></a>00718     <span class="keyword">enum</span> rt_device_class_type <a class="code" href="structrt__object.html#a87fff935df5a56027657597120071149">type</a>;                     
<a name="l00719"></a>00719     rt_uint16_t               <a class="code" href="structrt__object.html#aa2b7be2eb353a54b8319ae285fff23f4">flag</a>;                     
<a name="l00720"></a>00720     rt_uint16_t               open_flag;                
<a name="l00722"></a>00722     rt_uint8_t                device_id;                
<a name="l00724"></a>00724     <span class="comment">/* device call back */</span>
<a name="l00725"></a>00725     <a class="code" href="group__BasicDef.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> (*rx_indicate)(rt_device_t dev, rt_size_t size);
<a name="l00726"></a>00726     <a class="code" href="group__BasicDef.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> (*tx_complete)(rt_device_t dev, <span class="keywordtype">void</span> *buffer);
<a name="l00727"></a>00727 
<a name="l00728"></a>00728     <span class="comment">/* common device interface */</span>
<a name="l00729"></a>00729     <a class="code" href="group__BasicDef.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>  (*init)   (rt_device_t dev);
<a name="l00730"></a>00730     <a class="code" href="group__BasicDef.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>  (*open)   (rt_device_t dev, rt_uint16_t oflag);
<a name="l00731"></a>00731     <a class="code" href="group__BasicDef.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>  (*close)  (rt_device_t dev);
<a name="l00732"></a>00732     <a class="code" href="group__BasicDef.html#ga8011d259fdfc54b8a9aa006b4d49ac14">rt_size_t</a> (*read)   (rt_device_t dev, rt_off_t pos, <span class="keywordtype">void</span> *buffer, rt_size_t size);
<a name="l00733"></a>00733     <a class="code" href="group__BasicDef.html#ga8011d259fdfc54b8a9aa006b4d49ac14">rt_size_t</a> (*write)  (rt_device_t dev, rt_off_t pos, <span class="keyword">const</span> <span class="keywordtype">void</span> *buffer, rt_size_t size);
<a name="l00734"></a>00734     <a class="code" href="group__BasicDef.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a>  (*control)(rt_device_t dev, rt_uint8_t cmd, <span class="keywordtype">void</span> *args);
<a name="l00735"></a>00735 
<a name="l00736"></a>00736 <span class="preprocessor">#ifdef RT_USING_DEVICE_SUSPEND</span>
<a name="l00737"></a>00737 <span class="preprocessor"></span>    <a class="code" href="group__BasicDef.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> (*suspend) (rt_device_t dev);
<a name="l00738"></a>00738     <a class="code" href="group__BasicDef.html#ga42df42aabf676f2a89f5af2208b79950">rt_err_t</a> (*resumed) (rt_device_t dev);
<a name="l00739"></a>00739 <span class="preprocessor">#endif</span>
<a name="l00740"></a>00740 <span class="preprocessor"></span>
<a name="l00741"></a>00741     <span class="keywordtype">void</span>                     *user_data;                
<a name="l00742"></a>00742 };
<a name="l00743"></a>00743 
<a name="l00747"></a>00747 <span class="keyword">struct </span>rt_device_blk_geometry
<a name="l00748"></a>00748 {
<a name="l00749"></a>00749     rt_uint32_t sector_count;                           
<a name="l00750"></a>00750     rt_uint32_t bytes_per_sector;                       
<a name="l00751"></a>00751     rt_uint32_t block_size;                             
<a name="l00752"></a>00752 };
<a name="l00753"></a>00753 
<a name="l00757"></a>00757 <span class="keyword">struct </span>rt_device_blk_sectors
<a name="l00758"></a>00758 {
<a name="l00759"></a>00759     rt_uint32_t sector_begin;                           
<a name="l00760"></a>00760     rt_uint32_t sector_end;                             
<a name="l00761"></a>00761 };
<a name="l00762"></a>00762 
<a name="l00766"></a>00766 <span class="preprocessor">#define RT_DEVICE_CTRL_CURSOR_SET_POSITION  0x10</span>
<a name="l00767"></a>00767 <span class="preprocessor"></span><span class="preprocessor">#define RT_DEVICE_CTRL_CURSOR_SET_TYPE      0x11</span>
<a name="l00768"></a>00768 <span class="preprocessor"></span>
<a name="l00772"></a>00772 <span class="preprocessor">#define RTGRAPHIC_CTRL_RECT_UPDATE      0</span>
<a name="l00773"></a>00773 <span class="preprocessor"></span><span class="preprocessor">#define RTGRAPHIC_CTRL_POWERON          1</span>
<a name="l00774"></a>00774 <span class="preprocessor"></span><span class="preprocessor">#define RTGRAPHIC_CTRL_POWEROFF         2</span>
<a name="l00775"></a>00775 <span class="preprocessor"></span><span class="preprocessor">#define RTGRAPHIC_CTRL_GET_INFO         3</span>
<a name="l00776"></a>00776 <span class="preprocessor"></span><span class="preprocessor">#define RTGRAPHIC_CTRL_SET_MODE         4</span>
<a name="l00777"></a>00777 <span class="preprocessor"></span><span class="preprocessor">#define RTGRAPHIC_CTRL_GET_EXT          5</span>
<a name="l00778"></a>00778 <span class="preprocessor"></span>
<a name="l00779"></a>00779 <span class="comment">/* graphic deice */</span>
<a name="l00780"></a>00780 <span class="keyword">enum</span>
<a name="l00781"></a>00781 {
<a name="l00782"></a>00782     RTGRAPHIC_PIXEL_FORMAT_MONO = 0,
<a name="l00783"></a>00783     RTGRAPHIC_PIXEL_FORMAT_GRAY4,
<a name="l00784"></a>00784     RTGRAPHIC_PIXEL_FORMAT_GRAY16,
<a name="l00785"></a>00785     RTGRAPHIC_PIXEL_FORMAT_RGB332,
<a name="l00786"></a>00786     RTGRAPHIC_PIXEL_FORMAT_RGB444,
<a name="l00787"></a>00787     RTGRAPHIC_PIXEL_FORMAT_RGB565,
<a name="l00788"></a>00788     RTGRAPHIC_PIXEL_FORMAT_RGB565P,
<a name="l00789"></a>00789     RTGRAPHIC_PIXEL_FORMAT_RGB666,
<a name="l00790"></a>00790     RTGRAPHIC_PIXEL_FORMAT_RGB888,
<a name="l00791"></a>00791     RTGRAPHIC_PIXEL_FORMAT_ARGB888
<a name="l00792"></a>00792 };
<a name="l00793"></a>00793 
<a name="l00797"></a>00797 <span class="preprocessor">#define RTGRAPHIC_PIXEL_POSITION(x, y)  ((x &lt;&lt; 16) | y)</span>
<a name="l00798"></a>00798 <span class="preprocessor"></span>
<a name="l00802"></a>00802 <span class="keyword">struct </span>rt_device_graphic_info
<a name="l00803"></a>00803 {
<a name="l00804"></a>00804     rt_uint8_t  pixel_format;                           
<a name="l00805"></a>00805     rt_uint8_t  bits_per_pixel;                         
<a name="l00806"></a>00806     rt_uint16_t reserved;                               
<a name="l00808"></a>00808     rt_uint16_t width;                                  
<a name="l00809"></a>00809     rt_uint16_t height;                                 
<a name="l00811"></a>00811     rt_uint8_t *framebuffer;                            
<a name="l00812"></a>00812 };
<a name="l00813"></a>00813 
<a name="l00817"></a>00817 <span class="keyword">struct </span>rt_device_rect_info
<a name="l00818"></a>00818 {
<a name="l00819"></a>00819     rt_uint16_t x;                                      
<a name="l00820"></a>00820     rt_uint16_t y;                                      
<a name="l00821"></a>00821     rt_uint16_t width;                                  
<a name="l00822"></a>00822     rt_uint16_t height;                                 
<a name="l00823"></a>00823 };
<a name="l00824"></a>00824 
<a name="l00828"></a>00828 <span class="keyword">struct </span>rt_device_graphic_ops
<a name="l00829"></a>00829 {
<a name="l00830"></a>00830     void (*set_pixel) (<span class="keyword">const</span> <span class="keywordtype">char</span> *pixel, <span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y);
<a name="l00831"></a>00831     void (*get_pixel) (<span class="keywordtype">char</span> *pixel, <span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y);
<a name="l00832"></a>00832 
<a name="l00833"></a>00833     void (*draw_hline)(<span class="keyword">const</span> <span class="keywordtype">char</span> *pixel, <span class="keywordtype">int</span> x1, <span class="keywordtype">int</span> x2, <span class="keywordtype">int</span> y);
<a name="l00834"></a>00834     void (*draw_vline)(<span class="keyword">const</span> <span class="keywordtype">char</span> *pixel, <span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y1, <span class="keywordtype">int</span> y2);
<a name="l00835"></a>00835 
<a name="l00836"></a>00836     void (*blit_line) (<span class="keyword">const</span> <span class="keywordtype">char</span> *pixel, <span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, rt_size_t size);
<a name="l00837"></a>00837 };
<a name="l00838"></a>00838 <span class="preprocessor">#define rt_graphix_ops(device)          ((struct rt_device_graphic_ops *)(device-&gt;user_data))</span>
<a name="l00839"></a>00839 <span class="preprocessor"></span>
<a name="l00841"></a>00841 <span class="preprocessor">#endif</span>
<a name="l00842"></a>00842 <span class="preprocessor"></span>
<a name="l00843"></a>00843 <span class="preprocessor">#ifdef RT_USING_MODULE</span>
<a name="l00844"></a>00844 <span class="preprocessor"></span>
<a name="l00849"></a>00849 
<a name="l00850"></a>00850 <span class="comment">/*</span>
<a name="l00851"></a>00851 <span class="comment"> * module system</span>
<a name="l00852"></a>00852 <span class="comment"> */</span>
<a name="l00853"></a>00853 
<a name="l00854"></a>00854 <span class="preprocessor">#define RT_MODULE_FLAG_WITHENTRY        0x00            </span>
<a name="l00855"></a>00855 <span class="preprocessor">#define RT_MODULE_FLAG_WITHOUTENTRY     0x01            </span>
<a name="l00860"></a>00860 <span class="preprocessor">struct rt_module</span>
<a name="l00861"></a>00861 <span class="preprocessor"></span>{
<a name="l00862"></a>00862     <span class="keyword">struct </span><a class="code" href="structrt__object.html">rt_object</a>             parent;                
<a name="l00864"></a>00864     rt_uint8_t                  *module_space;          
<a name="l00866"></a>00866     <span class="keywordtype">void</span>                        *module_entry;          
<a name="l00867"></a>00867     rt_thread_t                  module_thread;         
<a name="l00868"></a>00868     rt_uint32_t                  stack_size;            
<a name="l00869"></a>00869     rt_uint32_t                  thread_priority;
<a name="l00870"></a>00870 
<a name="l00871"></a>00871 <span class="preprocessor">#ifdef RT_USING_SLAB</span>
<a name="l00872"></a>00872 <span class="preprocessor"></span>    <span class="comment">/* module memory allocator */</span>
<a name="l00873"></a>00873     <span class="keywordtype">void</span>                        *mem_list;              
<a name="l00874"></a>00874     <span class="keywordtype">void</span>                        *page_array;            
<a name="l00875"></a>00875     rt_uint32_t                  page_cnt;              
<a name="l00876"></a>00876 <span class="preprocessor">#endif</span>
<a name="l00877"></a>00877 <span class="preprocessor"></span>
<a name="l00878"></a>00878     rt_uint32_t                  nsym;                  
<a name="l00879"></a>00879     <span class="keyword">struct </span>rt_module_symtab     *symtab;                
<a name="l00881"></a>00881     rt_uint32_t                  nref;                  
<a name="l00883"></a>00883     <span class="comment">/* object in this module, module object is the last basic object type */</span>
<a name="l00884"></a>00884     <span class="keyword">struct </span><a class="code" href="structrt__object__information.html">rt_object_information</a> module_object[<a class="code" href="group__KernelObject.html#gga38a532bcb1bd3f12685db4219b761b56a7fd1d3fe31dd8000703a6198bd919c74">RT_Object_Class_Unknown</a>];
<a name="l00885"></a>00885 };
<a name="l00886"></a>00886 <span class="keyword">typedef</span> <span class="keyword">struct </span>rt_module *rt_module_t;
<a name="l00887"></a>00887 
<a name="l00889"></a>00889 <span class="preprocessor">#endif</span>
<a name="l00890"></a>00890 <span class="preprocessor"></span>
<a name="l00891"></a>00891 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00892"></a>00892 <span class="preprocessor"></span>}
<a name="l00893"></a>00893 <span class="preprocessor">#endif</span>
<a name="l00894"></a>00894 <span class="preprocessor"></span>
<a name="l00895"></a>00895 <span class="preprocessor">#endif</span>
</pre></div></div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>全部</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>类</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>文件</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>函数</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&nbsp;</span>变量</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&nbsp;</span>枚举</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&nbsp;</span>枚举值</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&nbsp;</span>宏定义</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address style="text-align: right;"><small>Generated at Mon Feb 10 20:46:09 2014 for EasyIO-GPRS-Framework by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>
